Calculate the length of the entry contents in characters, not in bytes.
authorMatthias Clasen <maclas@gmx.de>
Fri, 4 Jun 2004 01:19:55 +0000 (01:19 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 4 Jun 2004 01:19:55 +0000 (01:19 +0000)
Thu Jun  3 21:17:29 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
length of the entry contents in characters, not in bytes.

* gtk/gtkentry.c (paste_received): Don't pop up the completion
window on paste, noticed by Anders Carlsson.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentry.c

index 051135f1a8ad978630b56f8bd2662620975930a2..c53a74a920b0785eaf884be72f923ea8cbb12617 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu Jun  3 21:17:29 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
+       length of the entry contents in characters, not in bytes.
+
+       * gtk/gtkentry.c (paste_received): Don't pop up the completion
+       window on paste, noticed by Anders Carlsson.
+
 Thu Jun  3 20:56:19 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
index 051135f1a8ad978630b56f8bd2662620975930a2..c53a74a920b0785eaf884be72f923ea8cbb12617 100644 (file)
@@ -1,3 +1,11 @@
+Thu Jun  3 21:17:29 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
+       length of the entry contents in characters, not in bytes.
+
+       * gtk/gtkentry.c (paste_received): Don't pop up the completion
+       window on paste, noticed by Anders Carlsson.
+
 Thu Jun  3 20:56:19 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
index 051135f1a8ad978630b56f8bd2662620975930a2..c53a74a920b0785eaf884be72f923ea8cbb12617 100644 (file)
@@ -1,3 +1,11 @@
+Thu Jun  3 21:17:29 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
+       length of the entry contents in characters, not in bytes.
+
+       * gtk/gtkentry.c (paste_received): Don't pop up the completion
+       window on paste, noticed by Anders Carlsson.
+
 Thu Jun  3 20:56:19 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
index 051135f1a8ad978630b56f8bd2662620975930a2..c53a74a920b0785eaf884be72f923ea8cbb12617 100644 (file)
@@ -1,3 +1,11 @@
+Thu Jun  3 21:17:29 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
+       length of the entry contents in characters, not in bytes.
+
+       * gtk/gtkentry.c (paste_received): Don't pop up the completion
+       window on paste, noticed by Anders Carlsson.
+
 Thu Jun  3 20:56:19 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (gtk_combo_box_class_init): Fix the allowed
index 86d4a0f101475703b7f23b7899db892bfffa2529..1fc2848769e1aadc3b005f6c6c66cdef8bc619f2 100644 (file)
@@ -3418,6 +3418,14 @@ paste_received (GtkClipboard *clipboard,
   if (text)
     {
       gint pos, start, end;
+      GtkEntryCompletion *completion = gtk_entry_get_completion (entry);
+
+      if (completion)
+       {
+         g_signal_handler_block (entry, completion->priv->changed_id);
+         if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
+           _gtk_entry_completion_popdown (completion);
+       }
       
       if (gtk_editable_get_selection_bounds (editable, &start, &end))
         gtk_editable_delete_text (editable, start, end);
@@ -3425,6 +3433,9 @@ paste_received (GtkClipboard *clipboard,
       pos = entry->current_pos;
       gtk_editable_insert_text (editable, text, -1, &pos);
       gtk_editable_set_position (editable, pos);
+
+      if (completion)
+       g_signal_handler_unblock (entry, completion->priv->changed_id);
     }
 
   g_object_unref (entry);
@@ -4632,7 +4643,7 @@ gtk_entry_completion_timeout (gpointer data)
 
   completion->priv->completion_timeout = 0;
 
-  if (strlen (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)))
+  if (g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)), -1)
       >= completion->priv->minimum_key_length)
     {
       gint matches;